package sdmaker.parser;

import sdmaker.ast.AST;
import fsa.State;
import fsa.Transition;

public class ParseResult {
	private StateData startingState;
	private StateData finishingState;
	
	private AST resultingAST;
	private ParseResult previousParseResult; 
	private ParseResult nextParseResult; 
	private Transition lastTransition;
	private SetStateData treatedStates;
	
	
	
	/* ************************ *
	 * ***** CONSTRUCTORS ***** *
	 * ************************ */
	
	public ParseResult(AST resultingAST, Transition lastTransition){
		this.startingState=null;
		this.finishingState=null;
		this.resultingAST= resultingAST;
		this.previousParseResult= null;
		this.nextParseResult=null;
		this.lastTransition= lastTransition;
		this.treatedStates=null;
	}
	
	public ParseResult(StateData startingState, StateData finishingState,
			AST resultingAST, Transition lastTransition,
			ParseResult previousParseResult, ParseResult nextParseResult,
			SetStateData treatedStates){
		this.startingState= startingState;
		this.finishingState= finishingState;
		this.resultingAST= resultingAST;
		this.previousParseResult= previousParseResult;
		this.nextParseResult=nextParseResult;
		this.lastTransition= lastTransition;
		this.treatedStates= treatedStates;
	}
	
	
	
	/* ************************ *
	 * ******** GETTERS ******* *
	 * ************************ */
	
	public StateData getStartingState(){
		return startingState;
	}
	
	public StateData getFinishingState(){
		return finishingState;
	}
	
	public AST getResultingAST(){
		return resultingAST;
	}
	
	public ParseResult getPreviousParseResult(){
		return previousParseResult;
	}
	
	public ParseResult getNextParseResult(){
		return nextParseResult;
	}
	
	public Transition getLastTransition(){
		return lastTransition;
	}
	
	public SetStateData getTreatedStates(){
		return treatedStates;
	}
	
	
	
	/* ********************************* *
	 * **** SETTERS/ADDERS/REMOVERS **** *
	 * ********************************* */
	
	public void setPreviousParseResult(ParseResult previousParseResult){
		this.previousParseResult= previousParseResult;
	}
	
	public void setNextParseResult(ParseResult nextParseResult){
		this.nextParseResult= nextParseResult;
	}
}
